Fix stack overflow when opening child dialog from notification center#17261
Conversation
Disable TrapFocus on the notifications center dialog because it launches child dialogs. When multiple dialogs trap focus simultaneously, a recursive focus loop occurs causing 'Maximum call stack size exceeded' errors. Fixes #16593
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17261Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17261" |
There was a problem hiding this comment.
Pull request overview
This PR addresses a dashboard runtime error (RangeError: Maximum call stack size exceeded) triggered when opening a child dialog (“View Response”) from within the Notifications Center dialog, caused by nested Fluent UI focus traps.
Changes:
- Disables focus trapping on the Notifications Center dialog to avoid infinite recursion when child dialogs open.
- Adds a
FluentDialogcascading parameter toNotificationEntryComponentto provide access to the parent dialog context.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Aspire.Dashboard/Components/Layout/MainLayout.razor.cs | Changes Notifications Center dialog parameters to set TrapFocus = false. |
| src/Aspire.Dashboard/Components/Dialogs/NotificationEntryComponent.razor.cs | Adds a FluentDialog cascading parameter to access the parent dialog context. |
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
|
❓ CLI E2E Tests unknown — 92 passed, 0 failed, 2 unknown (commit View all recordings
📹 Recordings uploaded automatically from CI run #26111508088 |
|
✅ No documentation update needed. docs_optional → bug_fix_restores_documented_behavior No signals triggered (signal_count = 0). This PR fixes a |
Summary
Fixes #16593
When clicking "View Response" from the Notifications Center dialog, a child dialog (TextVisualizer) opens. Because both dialogs have focus trapping enabled, the Fluent UI focus-trap handlers recurse infinitely between them, causing
RangeError: Maximum call stack size exceeded.Fix
Hide the parent notification center dialog while the child dialog is open, then restore it after the child closes. This prevents multiple dialogs from competing for focus simultaneously.
Changes
finallyblock after the child dialog closes.IDialogReferencefromOpenDialogAsyncso callers can await the dialog's completion.OnClickdoesn't return until the child dialog is closed. UseConfigureAwait(true)to stay on the Blazor sync context.Testing
Manually verified that:
finally)